package de.greenrobot.daogenerator;


import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Index;
import de.greenrobot.daogenerator.Property;
import de.greenrobot.daogenerator.Schema;


public class CustomDaoGenerator {

    public static void main(String[] args) throws Exception {
        Schema schema = new Schema(1000, "de.greenrobot.daoexample");

        addroom(schema);

        new DaoGenerator().generateAll(schema, "/tmp/src-gen");
        
    }

    private static void addroom(Schema schema) {
        Entity room = schema.addEntity("Room");
        
        room.addIntProperty("price").notNull();
        room.addIntProperty("length").notNull();
        room.addIntProperty("width").notNull();
        room.addIntProperty("height").notNull();
        Property property = room.addIdProperty().getProperty();       
        
        //add index
        Index index = new Index();
        index.addProperty(property);
        room.addIndex(index);
        
        
        
   
        
        
        
        
    }

    

}

